libxl: Reset toolstack_save file position in libxl
authorJason Andryuk <andryuk@aero.org>
Mon, 19 May 2014 18:36:37 +0000 (14:36 -0400)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 22 May 2014 15:35:22 +0000 (16:35 +0100)
commitb327a3f421bb57d262b7d1fb3c43b710852b103b
treed121383e70b0abed8804ae5f160bda6d55441f86
parent119d8a42d3bfe6ebc1785720e1a7260e5c698632
libxl: Reset toolstack_save file position in libxl

toolstack_save data is written to a temporary file in libxl and read
back in libxl-save-helper.  The file position must be reset prior to
reading the file, which is done in libxl-save-helper with lseek.

lseek is unsupported for pipes and sockets, so a wrapper passing such an
fd to libxl-save-helper fails the lseek.  Moving the lseek to libxl
avoids the error, allowing the save to continue.

Signed-off-by: Jason Andryuk <andryuk@aero.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_save_callout.c
tools/libxl/libxl_save_helper.c